package homework;

import org.junit.Test;

import java.util.Random;
import java.util.Scanner;

public class figure {
    @Test
    public void test01() {
        Random rand=new Random();
       int b= rand.nextInt(100)+1;
        int count=0;
        while(true){
            Scanner sc=new Scanner(System.in);
            int a= sc.nextInt();
            count++;
            if(a>b){
                System.out.println("你猜的数大了");
                continue;
            }if(a<b){
                System.out.println("你猜的数小了");
                continue;
            }if(a==b){
                System.out.println("恭喜你终于猜对啦!"+"你一共猜了"+count+"次");
                break;
            }
        }


    }
}
